<?php /*a:2:{s:60:"/www/wwwroot/www.moxiongdi.com/app/admin/view/info/view.html";i:1698050634;s:58:"/www/wwwroot/www.moxiongdi.com/app/admin/view/info/js.html";i:1698050634;}*/ ?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title><?php echo htmlentities($pagetitle); ?></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/admin/style/global.css" media="all">
  <style>
	  .layui-form-label{ width:10%;}
	  .layui-form-item .layui-input-inline{width: 80%;}
  </style>  
</head>
<body>

  <div class="layui-form layui-form-view" style="padding: 20px 30px 0 0;">
	  
		<div class="layui-form-item">
			<label class="layui-form-label">id</label>
			<div class="layui-input-inline"><?php echo htmlentities($r['id']); ?></div>
		</div>
		<div class="layui-form-item">	
			<label class="layui-form-label">栏目</label>
			<div class="layui-input-inline"><?php echo htmlentities($cat['name']); ?></div>
		</div>		
	  
	<?php foreach($data as $v): ?>
		<div class="layui-form-item">
			<label class="layui-form-label"><?php echo htmlentities($v['name']); ?></label>
			<div class="layui-input-inline">
				<?php switch($v['formtype']): case "date": ?>
						<?php echo htmlentities(date("Y-m-d H:i:s",!is_numeric($v['value'])? strtotime($v['value']) : $v['value'])); break; case "image": ?>
						<a class="imageField_fancybox" rel="<?php echo htmlentities($v['field']); ?>_rel" href="<?php echo htmlentities($v['value']); ?>" target="_blank"><img class="images" src="<?php echo htmlentities($v['value']); ?>" style="width:200px; border:1px green dotted"></a>
					<?php break; case "textarea": ?>
						<?php echo nl2br($v['value']); break; case "morepic": ?>
						<div class="morepic">
							<div class="morepic_box">
								<div class="piclist" data-field="<?php echo htmlentities($v['field']); ?>">
									<ul id="<?php echo htmlentities($v['field']); ?>_piclist_ul">
										<?php
										$morepic_arr=explode("\r\n",$v['value']);
										foreach($morepic_arr as $v2){
											if(!$v2){break;};
											$vs=explode("||",$v2);
										?>
										<li title="拖动我是可以排序的哦" draggable="false">
											<a class="piclist_img <?php echo htmlentities($v['field']); ?>_fancybox" rel="<?php echo htmlentities($v['field']); ?>_rel" title="<?=$vs[2]?>" href="<?=$vs[1]?>">
												<img src="<?=$vs[0]?>" draggable="false">
											</a>
											<div class="piclist_title"><?=$vs[2]?></div>
										</li>
										<?php
										}                     
										?>                                        
										<div class="clear"></div>
									</ul>
								</div>                                        
							</div>
						</div>
					<?php break; case "morevalue": ?>
						<table class="layui-table">
						    <thead>
							    <tr>
								<?php
								$morevalueField=str2arr($v['defaultval'],"{{RsSplit}}","{{FieldSplit}}");
								foreach($morevalueField as $v2){
								?>
								<th class="center" width="<?php echo htmlentities($v2[3]); ?>%"><?php echo htmlentities($v2[0]); ?></th>
								<?php
								}
								?>
							    </tr> 
						    </thead>
						    <tbody>
								<?php
								$morevalue=str2arr($v['value'],"{{RsSplit}}","{{FieldSplit}}");
								foreach($morevalue as $v2){
								?>								
								<tr>
									<?php
									foreach($morevalueField as $k3=>$v3){
									?>
									<td style="text-align:center;">
										<?php if($v3[1]=="image"): ?>
											<a class="imageField_fancybox" rel="<?php echo htmlentities($v['field']); ?>_rel" href="<?php echo htmlentities($v2[$k3]); ?>" target="_blank"><img class="images" src="<?php echo htmlentities($v2[$k3]); ?>" style="height:100px; border:1px green dotted"></a>
										<?php elseif($v3[1]=="video"): if($v2[$k3]): ?>
												<video style="height:200px" src="<?php echo htmlentities($v2[$k3]); ?>" controls="controls"></video>
											<?php else: ?>
												-
											<?php endif; elseif($v3[1]=="file"): ?>
											<a href="<?php echo htmlentities($v2[$k3]); ?>" target="_blank"><?php echo htmlentities($v2[$k3]); ?></a>
										<?php else: ?>
											<?php echo htmlentities($v2[$k3]); ?>
										<?php endif; ?>																				
									</td>
									<?php
									}
									?>
								</tr>
								<?php
								}
								?>
								</tbody>
							</table>
					<?php break; case "file": ?>
						<a href="<?php echo htmlentities($v['value']); ?>" target="_blank" style="color: green; text-decoration: underline;"><?php echo htmlentities($v['value']); ?></a>
					<?php break; case "video": if($v['value']): ?>
						<video style="width:400px" src="<?php echo htmlentities($v['value']); ?>" controls="controls"></video>
						<?php else: ?>
						-
						<?php endif; break; case "file": ?>
						<img class="images" src="<?php echo htmlentities($v['value']); ?>" style="width:200px; border:1px green dotted">
					<?php break; case "file": ?>
						<a href="<?php echo htmlentities($v['value']); ?>" target="_blank"><?php echo htmlentities($v['value']); ?></a>
					<?php break; case "editor": ?>
						<?php echo $v['value']; break; default: ?>
						<?php echo $v['value']; ?>
				<?php endswitch; ?>		  
			</div>
		</div>
	<?php endforeach; ?>
	
	<div class="layui-form-item layui-layout-admin" style="margin-top: 30px;">
		<div class="layui-input-block">
		   <div class="layui-footer" style="left: 0;">
			  <button type="reset" class="layui-btn layui-btn-primary close">关闭</button>
		  </div>
		</div>
	</div>  

  </div>

    <!--文件上传ajax调用的接口地址-->
  <script>
    var upload_index="<?php echo url('file/index'); ?>";
    var upload_add="<?php echo url('file/add'); ?>";
    var upload_config="<?php echo url('file/uploadConfig'); ?>";
  </script>

<!--公共必要的JS-->
<script src="/static/js/jquery.min.js"></script>
<script src="/static/admin/layui/layui.js"></script>
<script src="/static/js/globals.js"></script>
  
<!--百度编辑器开始-->
<script>
  //这里是用于配置编辑器里调用文件管理器的变量
  var ueditor_serverUrl="<?php echo url('File/ueditorImg'); ?>?pubid="+$("input[name='pubid']").val()
</script>
<script src="/static/ueditor/ueditor.config.js"></script> 
<script src="/static/ueditor/ueditor.all.js"></script> 
<script>
    $(function () {
        //循环实例化编辑器
        $(".news_editor").each(function(){
            var editor_name=$(this).attr("editor_name");
            var editor_width=$(this).attr("editor_width");
            var editor_height=$(this).attr("editor_height");
            var imgwidth=$(this).attr("imgwidth");
            var imgheight=$(this).attr("imgheight");
            var ue = UE.getEditor(editor_name, {
                initialFrameHeight: editor_height>0?editor_height:"0",
                initialFrameWidth: editor_width>0?editor_width:'100%',
				zIndex:1,
                imgwidth: imgwidth,
                imgheight: imgheight,
            });
        })

    })
</script>  
<!--百度编辑器结束-->

<!---百度地图-->
<script type="text/javascript" src="/static/baidumap/setpoint.js"></script>
<script>
    $(".baidu_map_field").each(function(){
        var baidu_map=new baidumap();
        baidu_map.map_search_value_id=$(this).find(".map_search_value").attr("id");
        baidu_map.map_search_button_id=$(this).find(".map_search_button").attr("id");
        baidu_map.map_field_id=$(this).find(".map_point").attr("id"); 
        baidu_map.map_show_id=$(this).find(".map_show").attr("id");         
        baidu_map.showPoint=0;//如果修改信息的话需要显示之前的标记，这里请设置1  增加信息设置0        
        //启动地图显示区方法
        baidu_map.newmap();        
        //启动地址模糊搜索方法
        baidu_map.map_search();
        //启动鼠标点击拾取坐标方法
        baidu_map.map_position();        
    })
</script>
  
<!--文件上传 start-->
<script type="text/javascript" src="/static/webuploader/kinderfile.js"></script>
<script type="text/javascript" src="/static/webuploader/Sortable.js"></script>    
<script type="text/javascript" src="/static/webuploader/morepic.js"></script>   


<!--以下是针对 快速上传单个文件插件-->  
<link rel="stylesheet" type="text/css" href="/static/webuploader/style/webuploader.css" />
<link rel="stylesheet" type="text/css" href="/static/webuploader/style/style.css" />
<script type="text/javascript" src="/static/webuploader/webuploader.js"></script>
<script type="text/javascript" src="/static/webuploader/fastupimg.js"></script>
<!--文件上传 end-->
<!--文件上传的预览功能中中也需要用到我 fancybox plus start-->
<link rel="stylesheet" type="text/css" href="/static/fancybox3/jquery.fancybox.min.css" media="screen" />	
<script type="text/javascript" src="/static/fancybox3/jquery.fancybox.min.js"></script>
<!--文件上传的预览功能中中也需要用到我 fancybox plus end-->


  <!--select2 js start-->
  <link rel="stylesheet" href="/static/select2/select2.css" media="all">
  <script src="/static/select2/select2.js"></script>
  <!--select2 js end-->
<script>
    $(function(){
        $(".thischeck_all").click(function(){
            var y=$(this).attr("val");
            var objname=$(this).attr("objname");
            if(y==0){
                $("."+objname).prop("checked", false);
                y=1;
            }else if(y==1){
                $("."+objname).prop("checked", true);
                y=0;
            }
            $(this).attr("val",y);
        })
    })

    //排序
    function update_order(obj,inputname){
        $("input[name='"+inputname+"']").val($(obj).val());
    }
//layer
  layui.config({
    base: '/static/admin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form', 'laydate'], function(){
    var $ = layui.$
	,laydate = layui.laydate
    ,form = layui.form;
	//时间控件
	$(".form-date").each(function(){
		var dataFormat=$(this).data("format");
		dataFormat=dataFormat?dataFormat:"yyy-MM-dd HH:mm:ss";
		laydate.render({
		  elem:this,
		  calendar: true,
		  format: dataFormat //可任意组合
		});
	});

	$('.select2').select2();
  })
//模型切换
function urlgo(obj){
  $val=$(obj).val();
  window.location.href='<?php echo url("Cat/add"); ?>?modelid='+$val;
}

//多值字段
function morevalue_add(obj,str){
    var randStr2=randStr();
    for (var i=0; i<30;i++){
        //一次替换三次randImgId，因为一个上传窗口需要替换id="randImgId" 和button里的selectfile('randImgId','','img','','')
        if(i%3==0){
            randStr2=randStr();
        }
        str = str.replace('randImgId',"img_"+randStr2);
        str = str.replace('randFileId',"file_"+randStr2);
        str = str.replace('randVideoId',"video_"+randStr2);
    }    
    $(obj).parents("tr").after(str);
}
function morevalue_del(obj){
    var len=$(obj).parents("tbody").children().length;
    if(len==1){
            alert("至少要保留一行数据");
            return false;
    }
    $(obj).parents("tr").remove();
}
//多值-图片预览
function morevaluePreImg(id){
    var src=$("#"+id).val();
    $.fancybox.open({src:src});
}
//多值-文件预览
function morevaluePreFile(id){
    var src=$("#"+id).val();
    window.open(src);
}
//多值-视频预览
function morevaluePreVideo(id){
    var src=$("#"+id).val();
	if(src){
            $.fancybox({
                    content:'<div class="fancybox_video_play"><video  style="width:800px;height:auto" id="fancybox_video_src" src="'+src+'" autoplay controls></video></div>',
            })
	}else{
            layer.msg("视频路径为空");
	}
}
//多值-textarea点击放大的效果
function moreBigTextarea(obj,type){
    layer.prompt({
        title:"内容编辑区域",
        formType: type,//1, //输入框类型，支持0（文本）默认1（密码）2（多行文本）
        area: ['400px', '240px'],
        value: $(obj).val(),
        btn:['确认']
    },function(value, index, elem){
        $(obj).val(value);
        layer.close(index);
    });
}


    //定时发布
    function confirm_time(){
      var currentDate = new Date().toISOString().slice(0, 16);
      layer.prompt({
        title: '定时发布时间',
        content: '<input id="dadada" required type="datetime-local" class="layui-layer-input" min="' + currentDate + '">',
        formType: 3
      }, function (enddate, index) {
        $('#publish_time').val(enddate)
        layer.close(index)
        $('#save_draft').click()
      })
    }

    var saveTimeout; // 使用 timeout 而不是 interval
    // 保存到草稿里
    function saveFormData() {
      $('#action_type').val('draft')//

      var action=$('.layui-form').attr("action");
      var method=$('.layui-form').attr("method");
      var data=$('.layui-form').serializeArray();
      $("#save_draft").html('<i class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"></i> 保存中');
      $.ajax({
        url:action,
        type:method,
        async:true,
        data:data,
        dataType:'json',
        success:function(result){
          var code=result.code;
          var msg=result.msg;
          var data=result.data;
          var url=result.url;
          if(code){
            if(data.cache_id){
              $("input[name='cache_id']").val(data.cache_id)
            }
            setTimeout(function(){
              $("#save_draft").html('<i class="layui-icon layui-icon-edit"></i> 存草稿');
            },1000)
          }
        },
        error:function(xhr,textStatus){
          alert("程序出错，请联系管理员");
        },
      })

    }
    //表单自动保存功能
    $(document).ready(function() {
      var form = $('.layui-form');
      // 表单字段变化事件
      form.on('input', function() {
        clearTimeout(saveTimeout); // 清除之前的 timeout
        saveTimeout = setTimeout(function() {
          saveFormData();
        }, 1000); // 设定等待时间，比如1秒
      });
    });

  </script>
<!--tiny编辑器开始-->
  <script>
    var GetWxArticleUrl="<?php echo url('tool/GetWxCrawler'); ?>";//微信抓取url
  </script>
<script src="/static/tinymce/tinymce.min.js"></script>
<script src="/static/tinymce/tinymce.config.js"></script>
<!--tiny编辑器结束-->
  <script>
	  $(".imageField_fancybox").fancybox();
  </script>
</body>
</html>